feat(cli): Add 'adk samples' command for easy sample discovery and setup #1077
+555
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit introduces the new
adk samples
command-line interface, enabling users to easily discover, download, and prepare ADK example agents for local use.Key features in this initial version:
Interactive Mode (
adk samples
):~/.adk/cache/samples/
, customizable with--cache-path
).agent.py
files.Direct Mode (
adk samples <sample_name>
):Sample Preparation:
adk-samples
subdirectory in the user's target output path (default: current working directory, customizable with--output-path
)..env
file within the prepared sample's directory, pre-filled with theGOOGLE_API_KEY
and configured for Google AI Studio backend.adk web
,adk run
, oradk api_server
.Configuration:
--cache-path
) and output base path (--output-path
).File Changes:
src/google/adk/cli/cli_samples.py
: New file containing the core logic for downloading, caching, listing, copying samples, and .env creation.src/google/adk/cli/cli_tools_click.py
: Modified to register the newadk samples
command and its options (--cache-path
,--output-path
).pyproject.toml
: Addedrequests
as a dependency for downloading sample archives.